<style>
.jylabel-switch {padding:0.3rem 0.5rem;}
.jylabel-switch.active{
	border-radius:1.5rem;
	background-color:#00c568;
	color:#fff;
}
.fui-icon-group .fui-icon-col-sm.border {
   border: 1px solid #999;
}
.fui-navbar .cartbtn {padding-right:0.3rem;background:#fff;opacity:1}
.fui-navbar .buybtn  {padding-left:0.3rem;background:#fff}
.fee-tag-nav, .fee-tagup-nav, .fee-disabled-nav {border-radius:1rem;height:2rem;line-height:1.95rem;color:#fff;width:100%;font-weight:400;font-size:0.7rem;margin:0.2rem 0;padding:0 0.2rem;text-align:center}
.fee-tagup {background:{{main.syscolor || 'red'}};color:#fff;width:auto;font-weight:400;font-size:0.55rem}
.fee-tag-nav ,.merchfee-tag-nav{background:{{main.syscolor || 'red'}}; opacity: 0.68;}
.merchfee-tag-nav, .merchfee-tagup-nav, .merchfee-disabled-nav {
    border-radius: 1rem;
    line-height: 1.5rem;
    color: #fff;
    width: 100%;
    font-weight: 400;
    font-size: 0.7rem;
    margin: 0.2rem 0;
    padding: 0 0.5rem;
    text-align: center;
}
.fee-tagup-nav, .merchfee-tagup-nav {background:{{main.syscolor || 'red'}};}
.fee-disabled-nav, .merchfee-disabled-nav {background:#bbb;color:#fff;}	
</style>
<div class='fui-page-group' ng-if="pagedata.op == 'main'">
<div class='fui-page  fui-page-current'>
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">配置清单</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content'>
		<div style="padding:0.5rem">
		<div class="fui-cell-group fui-cell-click mod-group" style="margin-top:0">
			<div class="fui-cell">
				<div class="fui-cell-label bold">项目名称</div>
				<div class="fui-cell-info">
				<input type="text" class="fui-input" placeholder="填写项目信息" ng-model="pagedata.post.xmtitle"/>
				</div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-label bold">联系人</div>
				<div class="fui-cell-info">
				<input type="text" class="fui-input" placeholder="填写联系人" ng-model="pagedata.post.name"/>
				</div>
				<div class="fui-cell-info" style="padding-left:0.3rem">
				<input type="text" class="fui-input" placeholder="填写联系电话" ng-model="pagedata.post.mobile"/>
				</div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-label bold">区域选择</div>
				<div class="fui-cell-info" style="padding:0.2rem;border: 1px solid #D9D9D9;">
						<select class="fui-input" ng-model="pagedata.post.pcd.province"  ng-change="pagedata.post.pcd.city=undefined;pagedata.post.pcd.district=undefined;pagedata.post.pcd.street=undefined">
							<option value="" selected="selected">省份</option>
							<option ng-repeat="(value,data) in pagedata.areas" ng-selected="pagedata.post.pcd.province==value"  value="{{value}}">{{value}}</option>
						</select>
				</div>
				<div class="fui-cell-info" style="padding:0.2rem;border: 1px solid #D9D9D9;">
						<select class="fui-input" ng-model="pagedata.post.pcd.city" ng-change="pagedata.post.pcd.district=undefined;pagedata.post.pcd.street=undefined">
							<option value="" selected="selected">城市</option>
							<option ng-repeat="(value,data) in pagedata.areas[pagedata.post.pcd.province]" ng-selected="pagedata.post.pcd.city==value" value="{{value}}">{{value}}</option>
						</select>
				</div>
				<div class="fui-cell-info" style="padding:0.2rem;border: 1px solid #D9D9D9;">
						<select class="fui-input" ng-model="pagedata.post.pcd.district" ng-change="pagedata.post.pcd.street=undefined">
							<option value="" selected="selected">区县</option>
							<option ng-repeat="(value,data) in pagedata.areas[pagedata.post.pcd.province][pagedata.post.pcd.city]" ng-selected="pagedata.post.pcd.district==value" value="{{value}}">{{value}}</option>
						</select>
				</div>
				<div class="fui-cell-info" style="padding:0.2rem;border: 1px solid #D9D9D9;">
						<select class="fui-input" ng-model="pagedata.post.pcd.street">
							<option value="" selected="selected">街道</option>
							<option ng-repeat="value in pagedata.areas[pagedata.post.pcd.province][pagedata.post.pcd.city][pagedata.post.pcd.district]" ng-selected="pagedata.post.pcd.street==value" value="{{value}}">{{value}}</option>
						</select>
				</div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-label bold">详细地址</div>
				<div class="fui-cell-info">
				<input type="text" class="fui-input" placeholder="填写详细地址" ng-model="pagedata.post.address"/>
				</div>
			</div>
		</div>
		<div class="fui-cell-group fui-cell-click mod-group">
			<div class="fui-icon-group col-4">
				<div class="fui-icon-col-sm external" style="width: 30%;">
					<div class="gray">品名</div>
				</div>
				<div class="fui-icon-col-sm external" style="width: 30%;">
					<div class="gray">型号</div>
				</div>
				<div class="fui-icon-col-sm external" style="width: 20%;">
					<div class="gray">数量</div>
				</div>
				<div class="fui-icon-col-sm external" style="width: 20%;">
					<div class="gray">价格</div>
				</div>
			</div>
			<div ng-repeat="item in pagedata.list" class="fui-icon-group col-4" style="border-top: 1px solid #f2f2f2;">
				<div class="fui-icon-col-sm" style="width: 30%;">
					<div class="info" style="font-size:0.6rem">{{item.title}}</div>
				</div>
				<div class="fui-icon-col-sm" style="width: 30%;">
					<div class="text">{{item.api_data.sn||'无'}}</div>
				</div>
				<div class="fui-icon-col-sm" style="width: 20%;">
					<div class="text">{{item.total}}{{item.unit}}</div>
				</div>
				<div class="fui-icon-col-sm" style="width: 20%;">
					<div class="text">￥{{item.price}}</div>
				</div>
				<i ng-if="pagedata.delshow" class="icon icon-jian bold" ng-click="post({},'/member.cart/del/id='+item.id)" style="font-size:0.6rem;color:red;position: absolute;left:0.3rem;top:0.3rem"></i>
			</div>
			<div class='content-empty' ng-show="!pagedata.list || pagedata.list.length<=0" style="margin:1rem;">
				<i class='fa fa-comment-o'></i><br/>没有配置任何信息!
			</div>
			<div ng-if="!pagedata.delshow" style="padding:0.5rem">
			<a class="weui_btn weui_btn_plain_primary" href="javascript:;" ng-click="pagedata.delshow=true">
				修改清单明细
			</a>
			</div>
		</div>
	</div>
	</div>
</div>
</div>
<div class="fui-navbar order-create-checkout">
    <a href="javascript:;" class="nav-item total" style="text-align:left;padding-left:0.5rem">
        <span class="text-danger bigprice">&yen; 
			<span class="totalprice" style="font-size:1.2rem">{{price(pagedata.totalprice) || '0.00'}}</span>
		</span>
		<div class="syscolor" style="font-size:0.6rem;margin-right:0.15rem;margin-top:-0.35rem">配置费用</div>
    </a>
	<a href="javascript:;" class="nav-item btn buybtn" ng-click="access_json('jy_kongtiaoshop/index/');">
		<div class="fee-tag-nav">
			返回首页
		</div>
	</a>
	<a ng-if="pagedata.total>0" href="javascript:;" class="nav-item btn buybtn" ng-click="post_json('jy_kongtiaoshop/member.cart/check_buy/',pagedata.post);">
		<div class="fee-tagup-nav">
			立即下单
		</div>
	</a>
    <a ng-if="pagedata.total<=0" href="javascript:;" class="nav-item btn buybtn">
		<div class="fee-disabled-nav">
			立即下单
		</div>
	</a>
</div>
<script>
//刷新总数和总价
scope.pagedata.refresh=function(){
	var total=0,totalprice=0.00;
	scope.pagedata.isselectall=1;
	for(var i=0;i<scope.pagedata.list.length;i++){
	   var merch=scope.pagedata.list[i];
	   total =total+1*merch.total;
	   totalprice =totalprice+1*merch.totalprice;
	}
	scope.pagedata.total=total;
	scope.pagedata.totalprice=scope.price(totalprice);
	scope.$evalAsync();
}
scope.pagedata.isfromcart=1;
scope.pagedata.list=[];
scope.pagedata.get_list=function(){
	scope.tool.get_list('jy_kongtiaoshop/member.cart/getlist/',true,function(res){
		scope.pagedata.refresh();
	});
}
//首次加载
scope.pagedata.get_list(true);
//滑到页面底部时加载下一页
scope.pagedata.scroll_bottom=function(){
	scope.tool.get_list('jy_kongtiaoshop/member.cart/getlist/');
}
scope.pagedata.getprovince=function(){
	scope.get('core/member.set/getprovince/',function(res){
		scope.pagedata.areas=res.province;
		scope.$evalAsync();
	});
}
scope.pagedata.getprovince();
</script>